package com.atguigu.gulimall.product.vo;

import com.atguigu.gulimall.product.entity.SkuImagesEntity;
import com.atguigu.gulimall.product.entity.SkuInfoEntity;
import com.atguigu.gulimall.product.entity.SpuInfoDescEntity;
import lombok.Data;
import lombok.ToString;

import java.io.Serializable;
import java.util.List;

/**
 * @author: jianPing
 * @date: 2022/3/21 13:55
 * @description:
 */
@Data
public class SkuItemVo implements Serializable {
    //1.sku基本信息
    private SkuInfoEntity info;
    //2.sku图片信息
    private List<SkuImagesEntity> images;
    //3.spu的销售属性组合
    private List<SkuItemSaleAttrVo> saleAttr;
    //4.获取spu的介绍
    private SpuInfoDescEntity desp;
    //5.获取spu的规格参数信息
    private List<SpuItemAttrGroupVo> groupAttrs;
    //6.是否有货
    private boolean hasStock = true;

    @Data
    public static class SkuItemSaleAttrVo{
        private Long attrId;
        private String attrName;
        private List<AttrValueWithSkuIdVo> attrValues;
    }

    @Data
    public static class AttrValueWithSkuIdVo{
        private String attrValue;
        private String skuIds;
    }

    @ToString
    @Data
    public static class SpuItemAttrGroupVo{
        private String groupName;
        private List<SpuBaseAttrVo> attrs;
    }

    @Data
    public static class SpuBaseAttrVo{
        private String attrName;
        private String attrValue;
    }
}
